package com.gc.server.vo.up;


import com.gc.server.entity.LinkHeadEntity;
import com.gc.server.entity.UserEntity;
import lombok.Data;

import java.util.Date;

import com.alibaba.excel.annotation.*;

import java.io.Serializable;


import com.gc.server.entity.UserHeadEntity;
import com.gc.server.vo.UserHeadVo;


/**
 * 用户总部关系实体
 * 表名 user_head
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date ${datetime}
 */
@Data
public class UserHeadUp implements Serializable {
    @ExcelIgnore
    private static final long serialVersionUID = 1L;


    //
    @ExcelProperty("")
    private Long id;

    //用户ID
    @ExcelProperty("用户ID")
    private Long userId;

    //用户ID
    @ExcelProperty("用户名")
    private String name;

    //用户ID
    @ExcelProperty("用户编号")
    private String code;

    //总部ID
    @ExcelProperty("总部ID")
    private Long headId;

    @ExcelProperty("总部名")
    private String headName;

    @ExcelProperty("总部编号")
    private String headCode;

    //备注
    @ExcelProperty("备注")
    private String remark;



    public UserHeadUp() {

    }

    public UserHeadVo toVo() {

        UserHeadEntity entity = new UserHeadEntity();
        UserHeadVo vo = new UserHeadVo(entity);
        entity.setId(id);
        entity.setUserId(userId);
        entity.setHeadId(headId);
        entity.setRemark(remark);
        UserEntity userEntity  = new UserEntity();
        userEntity.setCode(code);
        LinkHeadEntity headEntity  = new LinkHeadEntity();
        headEntity.setCode(headCode);
        vo.setHead(headEntity);
        vo.setUser(userEntity);
        return vo;
    }


}
